import request from '@/utils/request'

export function getByCode(caseCode) {
  return request({
    url: '/web-api/api/caseInfo/findByCode',
    method: 'get',
    params: { caseCode: caseCode }
  })
}

export function getList(query) {
  return request({
    url: '/web-api/api/caseInfo',
    method: 'get',
    params: query
  })
}

export function add(data) {
  return request({
    url: '/web-api/api/caseInfo',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: '/web-api/api/caseInfo/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: '/web-api/api/caseInfo',
    method: 'put',
    data
  })
}

export function findCase(query) {
  return request({
    url: '/web-api/api/caseInfo/list',
    method: 'get',
    params: query
  })
}

export function saveCaseCorrelation(data) {
  return request({
    url: '/web-api/api/pendingMatters/saveCaseCorrelation',
    method: 'post',
    data
  })
}

export function caseRegister(data) {
  return request({
    url: '/web-api/api/pendingMatters/caseRegister',
    method: 'post',
    data
  })
}

export function caseEnd(data) {
  return request({
    url: '/web-api/api/pendingMatters/caseEnd',
    method: 'post',
    data
  })
}

export function administrativePunish(data) {
  return request({
    url: '/web-api/api/pendingMatters/administrativePunish',
    method: 'post',
    data
  })
}

export function submission(data) {
  return request({
    url: '/web-api/api/pendingMatters/submission',
    method: 'post',
    data
  })
}

export function initiateFlowApproval(data) {
  return request({
    url: '/web-api/api/pendingMatters/initiateFlowApproval',
    method: 'get',
    params: data
  })
}

export function saveFlowApproval(data) {
  return request({
    url: '/web-api/api/pendingMatters/saveFlowApproval',
    method: 'post',
    data
  })
}

export function getFlowApproval(data) {
  return request({
    url: '/web-api/api/pendingMatters/getFlowApproval',
    method: 'get',
    params: data
  })
}

export function getFlowApprovalBack(data) {
  return request({
    url: '/web-api/api/pendingMatters/saveWord',
    method: 'get',
    params: data
  })
}

export function signatureDocument(params) {
  return request({
    url: '/web-api/api/pendingMatters/signatureDocument',
    method: 'get',
    params: params
  })
}

export function relatedMatters(data) {
  return request({
    url: '/web-api/api/pendingMatters/relatedMatters',
    method: 'post',
    data
  })
}

export function appendix(data) {
  return request({
    url: '/web-api/api/pendingMatters/appendix',
    method: 'post',
    data
  })
}

export function acceptCaseByCaseCode(params) {
  return request({
    url: '/web-api/api/pendingMatters/acceptCaseByCaseCode',
    method: 'get',
    params: params
  })
}

export function initiateApproval(params) {
  return request({
    url: '/web-api/api/pendingMatters/initiateApproval',
    method: 'get',
    params: params
  })
}

export function changeCaseStatusBySurvey(params) {
  return request({
    url: '/web-api/api/pendingMatters/changeCaseStatusBySurvey',
    method: 'get',
    params: params
  })
}

export function caseAudit(data) {
  return request({
    url: '/web-api/api/pendingMatters/auditCase',
    method: 'post',
    data
  })
}

export function evidenceExtract(params) {
  return request({
    url: '/web-api/api/pendingMatters/evidenceExtract',
    method: 'get',
    params: params
  })
}

export function revocationCase(data) {
  return request({
    url: '/web-api/api/pendingMatters/revocationCase',
    method: 'post',
    data
  })
}

export function caseCurrent(data) {
  return request({
    url: '/web-api/api/pendingMatters/caseCurrent',
    method: 'post',
    data
  })
}

export const downloadUrl = '/web-api/api/caseInfo/download'
